package com.hy.thread;

import com.hy.admin.service.YangCardOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class YangCardExpireThread implements Runnable{
    protected final Logger logBase = LoggerFactory.getLogger(YangCardExpireThread.class);

    YangCardOrderService yangCardOrderService = (YangCardOrderService) SpringContextUtil.getBean("yangCardOrderServiceImpl");

    @Override
    public void run() {
        try {
            Boolean result = false;
            while(!result) {
                //如果修改数据失败，5秒后继续直到成功为止
                Thread.sleep(5000);
                result = yangCardOrderService.cardExpire();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
